package com.openbravo.pos.reports;

import com.openbravo.pos.forms.AppLocal;

import java.util.HashMap;
import java.util.Map;

public class ReportFieldsArray
  implements ReportFields
{
  private Map m_keys = null;

  @SuppressWarnings("unchecked")
public ReportFieldsArray(String[] paramArrayOfString)
  {
	  m_keys = new HashMap();
	  //jyaokwe tsasyon HOST, SEQUENCE, MONEY, DATESTART, DATEEND, PAYMENT, TOTAL]
    for (int i = 0; i < paramArrayOfString.length; i++)
      this.m_keys.put(paramArrayOfString[i], new Integer(i));
  }

  public Object getField(Object paramObject, String paramString)
    throws ReportException
  {
    Integer localInteger = (Integer)this.m_keys.get(paramString);
    if (localInteger == null)
      throw new ReportException(AppLocal.getIntString("exception.unavailablefield", new Object[] { paramString }));
    Object[] arrayOfObject = (Object[])(Object[])paramObject;
    if ((arrayOfObject == null) || (localInteger.intValue() < 0) || (localInteger.intValue() >= arrayOfObject.length))
      throw new ReportException(AppLocal.getIntString("exception.unavailablefields"));
    return arrayOfObject[localInteger.intValue()];
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.reports.ReportFieldsArray
 * JD-Core Version:    0.6.0
 */